package com.netease.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.netease.Dao.ProductDao;
import com.netease.jichu.Product;

@Service
public class ProductService {
@Autowired
private ProductDao pd;
public void add(Product pro){
	//新增
	pd.insertProduct(pro);
}
public void update(Product pro){
	//更新
	pd.update(pro);
}
public Product getProduct(int id){
	//内容详情
	return pd.getproduct(id);
}
public List<Product> productAll(){
	//商品列表
	List<Product> pro = pd.productAll();
	return pro;
}
public void deleteProduct(int id){
	//删除商品
	pd.deleteProduct(id);
}
//public void set(Product product){
//	pd.set(product);
//	product.setBuy(true);
//	product.setSell(true);
//}
}
